﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/admincp.Master" AutoEventWireup="true"
    CodeBehind="SearchPrice.aspx.cs" Inherits="SES.CMS.AdminCP.SearchPrice" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:HiddenField Value="" runat="server" ID="hdfID" />
    <asp:Panel ID="pnView" runat="server">
        <h2>
            Quản lý giá</h2>
        <div style="float: left; width: 100%;">
            <asp:GridView ID="gvSearchPrice" DataKeyNames="Id" runat="server" AutoGenerateColumns="False"
                OnRowDeleting="gvSearchPrice_RowDeleting" PageSize="50" CssClass="tstyle2" Width="100%"
                PagerStyle-CssClass="pgr" AllowPaging="true" OnPageIndexChanging="gvSearchPrice_PageIndexChanging"
                OnRowCommand="gvSearchPrice_RowCommand">
                <Columns>
                    <asp:TemplateField HeaderText="Số TT" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%#Container.DataItemIndex +1 %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Giá từ" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:Label ID="lblFromPrice" runat="server" Text='<%#Eval("FromPrice","{0:0,0 VNĐ}")%>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Đến giá" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:Label ID="lblToPrice" runat="server" Text='<%#Eval("ToPrice","{0:0,0} VNĐ")%>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="13%" HeaderText="Thao tác" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:ImageButton ID="btEdit" runat="server" CommandArgument='<%#Eval("Id") %>' CommandName="Select"
                                ImageUrl="~/AdminCP/images/edit_16x16.gif" />
                            <asp:ImageButton ID="btDelete" runat="server" CommandArgument='<%#Eval("Id") %>'
                                CommandName="Delete" ImageUrl="~/AdminCP/images/delete_16x16.gif" OnClientClick="return confirm('Có muốn xóa bản ghi này? Nhấn OK để xóa!')" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <br />
            <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="Thêm mới" CssClass="button-gg-green" />
        </div>
    </asp:Panel>
    <asp:Panel ID="pnInsert" runat="server">
        <h2>
            Thêm mới giá</h2>
        <table class="tablet">
            <tr>
                <td class="style8" style="width: 150px;">
                    Giá từ:
                </td>
                <td class="style9" colspan="3">
                    <asp:TextBox ID="txtFrmPrice" runat="server" Width="350px" ValidationGroup="submitGrp"></asp:TextBox>
                    <asp:FilteredTextBoxExtender ID="txtFrmPrice_FilteredTextBoxExtender" FilterType="Numbers"
                        runat="server" Enabled="True" TargetControlID="txtFrmPrice">
                    </asp:FilteredTextBoxExtender>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFrmPrice"
                        ErrorMessage="***" ValidationGroup="submitGrp"></asp:RequiredFieldValidator>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style8" style="width: 150px;">
                    Đến giá:
                </td>
                <td class="style9" colspan="3">
                    <asp:TextBox ID="txtToPrice" runat="server" Width="350px" ValidationGroup="submitGrp"></asp:TextBox>
                    <asp:FilteredTextBoxExtender ID="txtToPrice_FilteredTextBoxExtender" FilterType="Numbers"
                        runat="server" Enabled="True" TargetControlID="txtToPrice">
                    </asp:FilteredTextBoxExtender>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtToPrice"
                        ErrorMessage="***" ValidationGroup="submitGrp"></asp:RequiredFieldValidator>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style8">
                    &nbsp;
                </td>
                <td class="style4" colspan="3">
                    <asp:Button ID="btnSave" runat="server" Text="Lưu" OnClick="btnSave_Click" ValidationGroup="submitGrp"  CssClass="button-gg-green"/>
                    <asp:Button ID="btnReset" runat="server" Text="Hủy" OnClick="btnReset_Click"  CssClass="button-gg-green"/>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
